import request from '@/utils/request'

// 创建用户
export function listUser(data) {
  return request({
    url: `/kd_manage/user/list`,
    method: 'post',
    data: data
  })
}

// 创建用户
export function addUser(data) {
  return request({
    url: `/kd_manage/user/create`,
    method: 'post',
    data: data
  })
}

// 创建用户
export function getUser(userId) {
  const params = { userId }
  return request({
    url: `/kd_manage/user/detail`,
    method: 'get',
    params: params
  })
}

// 更新用户信息
export function updateUser(userId, data) {
  data.id = userId
  return request({
    url: `/kd_manage/user/update`,
    method: 'post',
    data: data
  })
}

// 删除用户
export function deleteUser(userId) {
  return request({
    url: `/kd_manage/user/delete`,
    method: 'post',
    data: {
      userId
    }
  })
}

// 修改用户密码
export function resetKdUserPw(data) {
  return request({
    url: `/kd_manage/user/reset_pw`,
    method: 'post',
    data: data
  })
}

// 免登陆跳转平台
export function checkPageJumpTo(data) {
  return request({
    url: '/kd_manage/user/checkPageJumpTo',
    method: 'post',
    params: data
  })
}
// 获取享扫平台登录地址
export function pay_platform_login(data) {
  return request({
    url: '/uaa/manage/login/pay_platform_login',
    method: 'get',
    params: data
  })
}
